from config import Config, config
from flask_sqlalchemy import SQLAlchemy
from flask import Flask

from flask_session import Session
db = SQLAlchemy()

def create_app(config_name):
    app = Flask(__name__)
    app.config.from_object(config[config_name])
    db.init_app(app)

    Session(app)
    from info.modules.index import  index_blue
    app.register_blueprint(index_blue)
    return app
